﻿<!DOCTYPE html>
<!--[if (gte IE 9)|!(IE)]><!-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<!-- Basic Page Needs -->
	<meta charset="UTF-8">
	<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->
	<title>My Account</title>

	<!-- Mobile Specific Metas -->
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<!-- Boostrap style -->
	<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">

	<!-- Theme style -->
	<link rel="stylesheet" type="text/css" href="/css/style.css">
	<link rel="stylesheet" type="text/css" href="/css/shortcodes.css">

	<!-- Reponsive -->
	<link rel="stylesheet" type="text/css" href="/css/responsive.css">


	<script type="text/javascript" src="/js/jquery-1.5.1.min.js"></script>
	<script type="text/javascript" src="/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="/js/passport.common.js?v20140531"></script>
	<script type="text/javascript" src="/js/jquery.alerts.js"></script>
	<!--mainStart-->
	<link rel="stylesheet" type="text/css" href="/css/reg.css?v20140432"/>
	<script type="text/javascript" src="/js/allMail.js?v20140430"></script>
	<script type="text/javascript" src="/js/reg.js?v20150122"></script>
</head>
<body class="header_sticky">
	<div class="boxed">


		<section id="header" class="header">

			<div th:replace="./module/header::header"></div>
			<div th:replace="./module/category::category"></div>

		</section><!-- /#header -->

		<section class="flat-breadcrumb">
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<ul class="breadcrumbs">
							<li class="trail-item">
								<a href="#" title="">主页</a>
								<span><img src="/images/icons/arrow-right.png" alt=""></span>
							</li>
							<li class="trail-item">
								<a href="#" title="">账户</a>
								<span><img src="/images/icons/arrow-right.png" alt=""></span>
							</li>
							<li class="trail-end">
								<a href="#" title="">登录</a>
							</li>
						</ul><!-- /.breacrumbs -->
					</div><!-- /.col-md-12 -->
				</div><!-- /.row -->
			</div><!-- /.container -->
		</section><!-- /.flat-breadcrumb -->

		<section class="flat-account background">
			<div class="container">
				<div class="row">
					<div class="col-md-6">
						<div class="form-login">
							<div class="title">
								<h3>登录</h3>
							</div>
							<form id="logForm_mod" name="logForm_mod" method="post">
								<div class="form-box">
									<label for="logName">手机/验证邮箱/用户名</label>
									<input id="logName" name="username" class="regInput" type="text" />
									<span class="regInput" id="userlogMamErr"></span>
								</div><!-- /.form-box -->
								<div class="form-box">
									<label for="logPwd">请输入密码</label>
									<input id="logPwd" name="password" class="regInput" autocomplete="off" type="password"/>
									<span class="regInput" id="passwordlogErr"></span>
								</div><!-- /.form-box -->
								<div class="form-box checkbox">
									<input type="checkbox" id="welcome" >
									<label for="welcome">欢迎登录</label>
								</div><!-- /.form-box -->
							</form><!-- /#form-login -->
							<button  href="javascript:void(0);"  class="button-rl" id="log_per_data" onclick="LOGIN.log()">立即登录</button>
							<a href="#" title="">Lost your password?</a>
						</div><!-- /.form-login -->
					</div><!-- /.col-md-6 -->
					<div class="col-md-6">
						<div class="form-register">
							<div class="title">
								<h3>注册</h3>
							</div>
							<form id="regForm_mod" name="regForm_mod" method="post">
								<div class="form-box">
									<label for="regName">账户名：</label>
									<input id="regName" name="username" class="regInput" type="text" onkeyup="mail_div(event);"
									onfocus="showtip('regName','userMamErr',8);" onblur="ckmem();" autocomplete="off"
									maxlength="80"/>
									<span class="regInput" id="userMamErr"></span>
									</div><!-- /.form-box -->
								<div class="form-box">
									<label for="pwd">登录密码：</label>
									<input id="pwd" name="password" class="regInput" autocomplete="off" type="password"
										   onfocus="showPwdtip('password','passwordErr',2);" onkeyup="ckpwd(0,1);" onblur="ckpwd(0,0);"/>
									<span class="regInput" id="passwordErr"></span>
								</div><!-- /.form-box -->
								<div class="form-box">
									<label for="pwdRepeat">确认密码：</label>
									<input id="pwdRepeat" name="password2" autocomplete="off" class="regInput" type="password"
										   onfocus="showtip('password2','password2Err',3);" onblur="ckpwd2();"/>
									<span class="regInput" id="password2Err"></span>
								</div><!-- /.form-box -->
								<div class="form-box">
									<label for="pwdRepeat">验证手机：</label>
									<input id="phone" name="phone" autocomplete="off" class="regInput" type="text" maxlength="11"
										   onfocus="showtip('phone','phoneErr',1);" onblur="$('#phoneErr').html('')"/>
									<span class="regInput" id="phoneErr"></span>
								</div><!-- /.form-box -->
								<div class="form-box checkbox">
									<input type="checkbox" id="agree" checked name="agree">
									<label for="agree">同意注册</label>
								</div><!-- /.form-box -->
							</form>

							<button  href="javascript:void(0);"  class="button-rl" id="reg_per_data" onclick="REGISTER.reg()">立即注册</button><!-- /#form-register -->
						</div><!-- /.form-register -->
					</div><!-- /.col-md-6 -->
				</div><!-- /.row -->
			</div><!-- /.container -->
		</section><!-- /.flat-account -->

		<section class="footer-bottom">
			<div class="container">
				<div class="row">
					<div class="col-md-12">
						<p class="copyright">欢迎访问我的博客：<a target="_blank" href="http://kiwi1.cn">kiwi1.cn</a></p>
						<p class="btn-scroll">
							<a href="#" title="">
								<img src="/images/icons/top.png" alt="">
							</a>
						</p>
					</div><!-- /.col-md-12 -->
				</div><!-- /.row -->
			</div><!-- /.container -->
		</section><!-- /.footer-bottom -->

	</div><!-- /.boxed -->

		<!-- Javascript -->
		<script type="text/javascript" src="/js/jquery.min.js"></script>
		<script type="text/javascript" src="/js/tether.min.js"></script>
		<script type="text/javascript" src="/js/bootstrap.min.js"></script>
		<script type="text/javascript" src="/js/waypoints.min.js"></script>
		<script type="text/javascript" src="/js/jquery.circlechart.js"></script>
		<script type="text/javascript" src="/js/easing.js"></script>
		<script type="text/javascript" src="/js/jquery.flexslider-min.js"></script>
		<script type="text/javascript" src="/js/owl.carousel.js"></script>
		<script type="text/javascript" src="/js/smoothscroll.js"></script>
		<script type="text/javascript" src="/js/jquery-ui.js"></script>
		<script type="text/javascript" src="/js/jquery.mCustomScrollbar.js"></script>
	   	<script type="text/javascript" src="/js/gmap3.min.js"></script>
	   	<script type="text/javascript" src="/js/waves.min.js"></script>
		<script type="text/javascript" src="/js/jquery.countdown.js"></script>

		<script type="text/javascript" src="/js/main.js"></script>

	<script type="text/javascript">
		var REGISTER = {
			param: {
				surl: "http://localhost:8087/page/my-account"
			},
			inputcheck: function () {
				var flag = true;
				//不能为空检查
				if ($("#regName").val() == "") {
					showError("regName", "userMamErr", defaultArr[8]);
					flag = false;
				}
				if ($("#pwd").val() == "") {
					showError("pwd", "passwordErr", pwdArr[0]);
					flag = false;
				}
				if ($("#phone").val() == "") {
					showError("phone", "phoneErr", memArr[0]);
					flag = false;
				}
				//密码检查
				if ($("#pwd").val() != $("#pwdRepeat").val()) {
					showError("pwdRepeat", "password2Err", pwd2Arr[1]);
					flag = false;
				}
				return flag;
			},
			doSubmit: function () {
				$.post("/user/register", $("#regForm_mod").serialize(), function (data) {
					if (data.status == 200) {
						jAlert('用户注册成功，请登录！', "提示", function () {
							REGISTER.login();
						});
					} else {
						jAlert("注册失败！", "提示"+ data.msg, "失败");
					}
				});
			},
			login: function () {
				location.href = this.param.surl;
				return false;
			},
			reg: function () {
				if (this.inputcheck()) {
					this.doSubmit();
				}
			}
		};
	</script>

	<script type="text/javascript" >
		var LOGIN = {
			param: {
				hurl: "http://localhost:8088/index"
			},
			checkInput: function () {
				var flag = true;
				if ($("#logName").val() == "") {
					showError("logName", "userlogMamErr", defaultArr[8]);
					flag = false;
				}
				if ($("#logPwd").val() == "") {
					showError("logPwd", "passwordlogErr", pwdArr[0]);
					flag = false;
				}
				return flag;
			},
			doLogin: function () {
				$.post("/user/login", $("#logForm_mod").serialize(), function (data) {
					if (data.status == 200) {
						jAlert('登录成功！', "提示", function () {
							LOGIN.index();
						});


					} else {
						jAlert("登录失败，原因是：" + data.msg, "失败");
					}
				});
			},
            index: function () {
                location.href = LOGIN.param.hurl;
                return false;
            },
		log: function () {
			if (this.checkInput()) {
				this.doLogin();
			}
		}
	};
	</script>
</body>	
</html>
